package Hibernate.dao;

import java.util.ArrayList;
import java.util.HashMap;

import net.sf.json.JSONObject;

/**
 * Score entity. @author MyEclipse Persistence Tools
 */

public class Score implements java.io.Serializable {

	// Fields

	private Integer id;
	private String userId;
	private String expertId;
	private String examId;
	private String firstScore;
	private String finalScore;
	private String scoreTime;

	// Constructors

	/** default constructor */
	public Score() {
	}

	/** full constructor */
	public Score(String userId, String expertId, String examId,
			String firstScore, String finalScore, String scoreTime) {
		this.userId = userId;
		this.expertId = expertId;
		this.examId = examId;
		this.firstScore = firstScore;
		this.finalScore = finalScore;
		this.scoreTime = scoreTime;
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getExpertId() {
		return this.expertId;
	}

	public void setExpertId(String expertId) {
		this.expertId = expertId;
	}

	public String getExamId() {
		return this.examId;
	}

	public void setExamId(String examId) {
		this.examId = examId;
	}

	public String getFirstScore() {
		return this.firstScore;
	}

	public void setFirstScore(String firstScore) {
		this.firstScore = firstScore;
	}

	public String getFinalScore() {
		return this.finalScore;
	}

	public void setFinalScore(String finalScore) {
		this.finalScore = finalScore;
	}

	public String getScoreTime() {
		return this.scoreTime;
	}

	public void setScoreTime(String scoreTime) {
		this.scoreTime = scoreTime;
	}

	//传给主服务器的是finalScore表数据
	
	/*@Override
	public String toString() {
		return "{id:'" + id + "', userId:'" + userId + "', expertId:'"
				+ expertId + "', examId:'" + examId + "', firstScore:'"
				+ firstScore + "', finalScore:'" + finalScore
				+ "', scoreTime:'" + scoreTime + "'}";
	}

	//输出excel
	public ArrayList<String> getInfo(String[] list){
		JSONObject jexamieeInfo = JSONObject.fromObject(this.toString());
		ArrayList<String> array = new ArrayList<String>();
		for(int i=0;i<list.length;i++){
			array.add(jexamieeInfo.getString(list[i]));
		}
		return array;
	}
	
	//输入excel
	public void setInfo (HashMap<String,String> userInfo){
		if(userInfo.containsKey("userId")){
			this.setUserId(userInfo.get("userId"));
		}
		if(userInfo.containsKey("expertId")){
			this.setExpertId(userInfo.get("expertId"));
		}
		if(userInfo.containsKey("examId")){
			this.setExamId(userInfo.get("examId"));
		}
		if(userInfo.containsKey("firstScore")){
			this.setFirstScore(userInfo.get("firstScore"));
		}
		if(userInfo.containsKey("finalScore")){
			this.setFinalScore(userInfo.get("finalScore"));
		}
		if(userInfo.containsKey("scoreTime")){
			this.setScoreTime(userInfo.get("scoreTime"));
		}
	}*/
	
	

}